package com.cke.yang.preview.infra.enums;

import lombok.Getter;

/**
 * 交换链接的模式枚举
 *
 * @author yuyang
 * @date 2025-11-18 00:00:00
 */
@Getter
public enum ExchangeLinkModeEnum {

    /**
     * 默认模式
     */
    DEFAULT("default", "默认模式")
    ;
    
    private String code;
    
    private String desc;

    ExchangeLinkModeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }
    
    public static ExchangeLinkModeEnum parseByCode(String code) {
        if (code == null) {
            return null;
        }
        for (ExchangeLinkModeEnum mode : ExchangeLinkModeEnum.values()) {
            if (mode.getCode().equals(code)) {
                return mode;
            }
        }
        return null;
    }
}
